<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>确认订单</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <script src="__ROOT__/static/home/js/shop/rem.js"></script>
    <script type="text/javascript" src="__ROOT__/static/home/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="__ROOT__/static/plugins/layer.mobile-v2.0/layer_mobile/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="__ROOT__/static/home/css/shop/base.css"/>
    <link rel="stylesheet" type="text/css" href="__ROOT__/static/home/css/shop/page.css"/>
    <link rel="stylesheet" type="text/css" href="__ROOT__/static/home/css/shop/all.css"/>
    <link rel="stylesheet" type="text/css" href="__ROOT__/static/home/css/shop/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="__ROOT__/static/home/css/shop/loaders.min.css"/>
    <link rel="stylesheet" type="text/css" href="__ROOT__/static/home/css/shop/loading.css"/>
    <link rel="stylesheet" type="text/css" href="__ROOT__/static/home/css/shop/slick/slick.css"/>
    <link rel="stylesheet" type="text/css" href="__ROOT__/static/home/css/shop/goodscats.css"/>
    <link rel="stylesheet" type="text/css" href="__ROOT__/static/plugins/bootstrap/css/bootstrap.css"/>
    <script type="text/javascript">
        $(window).load(function(){
            $(".loading").addClass("loader-chanage")
            $(".loading").fadeOut(300)
        })
    </script>
    <style>
        a{ color:#fcfcfc; text-decoration: none; }
        a:link {
            text-decoration:none;
        }
        a:visited {
            text-decoration:none;
        }
        a:hover {
            text-decoration:none;
        }
        a:active {
            text-decoration:none;
        }
    </style>
</head>
<!--loading页开始-->

<!--loading页结束-->
<body>
<!--header star-->
<header class="mui-bar mui-bar-nav" id="header">
    <a class="btn" href="javascript:history.go(-1)">
        <i class="iconfont icon-fanhui"></i>
    </a>
    <div class="top-sch-box top-sch-boxtwo flex-col">
        确认订单
    </div>
</header>
<!--header end-->

<div class="warp warptwo clearfloat"  style="margin-top: 60px;">
    <div class="confirm clearfloat">
        <div class="add clearfloat box-s">
               <a href="{:url('home/Address/addressList')}">
                <div class="left clearfloat fl">
                    <i class="iconfont icon-dizhi1"></i>
                </div>
                </a>
                {empty name="userAddress"}
                <a href="{:url('home/Address/addressList')}">
                <div class="middle clearfloat fl">
                    <p class="tit">
                 没有默认收货地址，请设置：默认收货地址
                    </p>
                </div>
                </a>
                {else /}
                <a href="{:url('home/Address/addressList')}">
                <div class="middle clearfloat fl">
                    <p class="tit">
                        收货人：{$userAddress['user_name']}&nbsp;&nbsp;&nbsp;&nbsp;{$userAddress['phone']}
                    </p>
                    <p class="fu-tit over2" style="font-size:20px; "  >
                        收货地址：{$userAddress['address']}
                    </p>
                </div>
                </a>
                {/empty}
               <a href="{:url('home/Address/addressList')}">
                <div class="left clearfloat fr">
                    <i class="iconfont icon-jiantou1"></i>
                </div>
                </a>
        </div>
        <!-- 循环显示购买的商品-->
        {volist name='rows' id='data'  key='k'}
        <div class="lie clearfloat">
                <div class="tu clearfloat fl">
                    <img src="__ROOT__{$data['goods_url']}"/>
                </div>
            <div class="right clearfloat fl">
                <a href="">
                    <p class="tit over">{$data['goods_name']}</p>
                    <p class="fu-tit"></p>
                </a>
                <div class="xia clearfloat">
                    <a href="">
                        <p class="jifen fl over">单价:{$data['goods_amount']}，数量:{$data['goods_num']}</p>
                    </a>
                </div>
            </div>
        </div>
        {/volist}

        <div class="gmshu clearfloat box-s fl">
            <div class="gcontent clearfloat">
            </div>
        </div>
        <div class="gmshu gmshutwo clearfloat box-s fl">
            <div class="gcontent clearfloat">
                <p class="fl">配送方式</p>
                <div class="you clearfloat fr">
                    <span>快递 </span>
                </div>
            </div>
        </div>
        <div class="gmshu gmshuthree clearfloat box-s fl">
            <div class="gcontent clearfloat">
                <div class="you clearfloat fl">
                </div>
            </div>
        </div>
        <div class="gmshu clearfloat box-s fl">
            <p class="fr">共{$count}件商品   合计<samp>￥{$goodsTotalShow}</samp></p>
        </div>
    </div>
</div>

<!--settlement star-->
<div class="settlement clearfloat">
    <div class="zuo clearfloat fl box-s"  style="width:70%;"   >
        共<span>{$count}</span>件  总金额:<span>￥{$goodsTotalShow}</span>
    </div>
    <a href="javascript:;" class="fl db"  onclick="submitOrder()"     style="width:30%;"  >
        提交订单
    </a>
</div>
<!--settlement end-->

<!--footer star-->
<footer class="page-footer fixed-footer" id="footer">
    <ul>
        <li>
            <a href="{:url('home/Index/index')}">
                <i class="iconfont icon-shouye"></i>
                <p>首页</p>
            </a>
        </li>
        <li class="active">
            <a href="{:url('home/Goodscats/goodsCatsList')}">
                <i class="iconfont icon-icon04"></i>
                <p>分类</p>
            </a>
        </li>
        <li>
            <a href="{:url('home/Cart/cartList')}">
                <i class="iconfont icon-gouwuche"></i>
                <p>购物车</p>
            </a>
        </li>
        <li>
            <a href="{:url('home/Userinfo/index')}">
                <i class="iconfont icon-yonghuming"></i>
                <p>个人中心</p>
            </a>
        </li>
    </ul>
</footer>
<!--footer end-->
</body>
<script>
    //提交订单
    function submitOrder(){
        $.post("{:url('home/Cart/submitOrder')}",function(data){
            console.debug(data);
            if( data>0 ){
                layer.open({content: '提交成功',skin: 'msg',time: 3 });
                window.location.href="{:url('home/Cart/payment')}";
            }else if( data== -1 ){
                layer.open({content: '检测到你没有登录，请先登录',skin: 'msg',time: 3 });
                window.location.href="{:url('home/login/login')}";
                return;
            }else if( data== -2 ){
                layer.open({content: '没有默认地址，无法提交',skin: 'msg',time: 3 });
                return;
            }else if( data== -3 ){
                layer.open({content: '购物车没有商品，提交失败',skin: 'msg',time: 3 });
                return;
            }else if( data== -4 ){
                layer.open({content: '由于系统原因，提交失败',skin: 'msg',time: 3 });
                return;
            }
        })
    }

</script>
<!--<script type="text/javascript" src="js/jquery-1.8.3.min.js" ></script>-->
<!--<script src="js/mui.min.js"></script>-->
<!--<script src="js/others.js"></script>-->
<!--<script type="text/javascript" src="js/hmt.js" ></script>-->
<!--<script src="slick/slick.js" type="text/javascript" ></script>-->
<!--插件-->
<!--<link rel="stylesheet" href="css/swiper.min.css">-->
<!--<script src="js/swiper.jquery.min.js"></script>-->
</html>
